'''
Created on Nov 7, 2012

@author: peng
'''
import os

for file_name in os.listdir(''):
    f = open(os.path.join('/mnt/export/new-user-list', file_name))
    f_desc = open(os.path.join('/mnt/export/new-user-list-2', file_name))
    for line in f.readlines():
        values = line.split('\t')
        new_value = [values[0].replace('official', 'ofw'), values[1]]
        f_desc.write('\t'.join(new_value))
        f_desc.write('\n')
    f.close()
    f_desc.close()

f_desc = open(os.path.join('/mnt/export/new-user-list-2', '19700101'))
for line in open('/mnt/export/new-user-list/19700101', 'r'):
    values = line.split('\t')
    new_value = [values[0].replace('official', 'ofw'), values[1]]
    f_desc.write('\t'.join(new_value))

f_desc.close()




f_desc = open('')
for line in open('', 'r'):
    values = line.split('\t')
    if values[4] == 'official':
        values[4] = 'ofw'
    f_desc.write('\t'.join(values))

f_desc.close()



dolphin_app = ['6e1cd3bc2cda139a29b552ae5d742b80',
               'c193d4184fa743121f63b52786783fd1',
               '7602204983c15bdc9d571034f1c28202',
               '0430b1b9a46321c8facdbca3a64763cf',
               'f63cdbd0d71c89d34c9d345cb73137e9',
               '7772f9ca1e6710045684d3b4a4f0e65b',
               '5f932ec16fef7bb1d39ef75d51dd487e',
               'fc15fda4c481fd309d69df1ff3081bfd',
               '73e8bd7c89a26510923c6141c976ac40',
               'd0e577f2bd57e63c33ea1c499334bb56',
               'a23210004e18709b3c70deaee5302a27']

f = open('', 'w')
for line in open('', 'r'):
    values = line.split('\t')
    if values[0] in dolphin_app:
        continue
    f.write(line)
f.close()
